<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>软件管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(function() {
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		
				$.ajax({    
			        type: "POST",  
			        url: "${ctx}/project/sysSpServle/obj",  
			        contentType: "application/json;charset=UTF-8",  
			        dataType: "json",  
			        success: function (data) {  
			        	 $.each(data, function(i, obj){
			        	      $("#ser").append("<input name='servletName' class='sName' type='checkbox' value='"+obj.servletName+"'/>"+obj.servletName+"  ");
			        	 });      
			        	 }  
	    		});  
			});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/project/sysSpSoftware/">软件列表</a></li>
		<li class="active"><a href="${ctx}/project/sysSpSoftware/form?id=${sysSpSoftware.id}">软件<shiro:hasPermission name="project:sysSpSoftware:edit">${not empty sysSpSoftware.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="project:sysSpSoftware:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="sysSpSoftware" action="${ctx}/project/sysSpSoftware/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">软件名：</label>
			<div class="controls">
				<form:input path="softName" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">版本：</label>
			<div class="controls">
				<form:input path="edite" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">服务器名称：</label>
			<!--  <button type="button" id="bt"></button>-->
			<div class="controls" id="ser">
			<!--  <input type="hidden" name="servletName" id="servletName"/>-->
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注：</label>
			<div class="controls">
				<form:textarea path="remark" htmlEscape="false" rows="4" maxlength="255" class="input-xxlarge "/>
			</div>
		</div>
		<div class="form-actions">
			
			<shiro:hasPermission name="project:sysSpSoftware:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="window.location.href='${ctx}/project/sysSpSoftware'"/>
		</div>
	</form:form>
</body>
</html>